package com.zy.gittest.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @Auther: zhangy
 * @Date: 2018/10/11 11:24
 * @Description:
 */
@RestController
@RequestMapping(value = "/zhkj")
@Api(value = "TestSwagger  |  一个测试swagger功能的controller")
public class TestSwagger {

    @RequestMapping(value = "/getUserName",method = RequestMethod.GET)
    @ApiOperation(value = "获取用户姓名",notes = "test：仅1和2回复")
    @ApiImplicitParam(paramType = "quary",name = "userNumber",value = "用户编号")
    public String getUserName(@RequestParam Integer userNumber){

        if(userNumber == 1){
            return "zhangsan";
        }else if (userNumber == 2){
            return "lixing";
        }else if (userNumber == 3){
            return "libshu";
        }else{
            return "xiaomia";
        }

    }

}
